import re

from pandas.io import clipboard


def get_text_from_clipboard() -> str:
    return clipboard.paste()


def input_multilines(hint: str) -> str:
    print(hint)
    lines = []
    while True:
        line = input()
        if line:
            lines.append(line)
        else:
            break
    text = '\n'.join(lines)
    return text


def format_doxygen_comment(comment: str) -> str:
    s = comment.strip()
    s = re.sub(r'\n[ \t]*\*[\t ]+(?!@)', repl=' ', string=s, flags=re.NOFLAG)
    s = s.removeprefix('/**').removeprefix('/*').removesuffix('*/').strip()
    s = re.sub(r'^[ \t]*\*[ \t]*', repl='', string=s, flags=re.MULTILINE)
    return s


def check_value(value):
    assert value != '' and value is not None, 'Some configuration items are not configured, please check!'


def check_dict_value(my_dict: dict):
    list(map(check_value, my_dict.values()))
